/*
	Name:5_2
	Copyright:Take it at will
	Author:Rodney
	Date: 
	Description:
*/
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

void strrshif(char *s,int n);

int main()
{
    char s[100];
    int n;
    scanf("%d%s",&n,s);
    strrshif(s,n);
    
    printf("%s\n",s);
    }

void strrshif(char *s,int n)
{
    int i,j,l=strlen(s);
    char ch;
    for(i=0;i<n;i++)
    {
        ch = s[l-1];
        for(j=l-1;j>0;j--)
            s[j] = s[j-1];
        s[0] = ch;
    }
}
